package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.List;

/**
 * 用户实体类
 */
@TableName("t_user")
public class UserBean {
    /**
     * 用户id
     */
    @TableId(value = "pk_userId" ,type = IdType.AUTO)
    private Integer id;
    /**
     * 真实姓名
     */
    @TableField("u_name")
    private String name;
    /**
     * 帐号
     */
    @TableField("u_account")
    private String account;
    /**
     * 密码
     */
    @TableField("u_pwd")
    private String pwd ="666";
    /**
     * 角色集合
     */
    @TableField(exist = false)
    private List<RoleBean> roleList;
    /**
     * 权限集合
     */
    @TableField(exist = false)
    private List<GradeBean> gradeList;

    public UserBean() {
    }

    public UserBean(String name, String account) {
        this.name = name;
        this.account = account;
    }

    public List<GradeBean> getGradeList() {
        return gradeList;
    }

    public void setGradeList(List<GradeBean> gradeList) {
        this.gradeList = gradeList;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public List<RoleBean> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<RoleBean> roleList) {
        this.roleList = roleList;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", account='" + account + '\'' +
                ", pwd='" + pwd + '\'' +
                ", roleList=" + roleList +
                ", gradeList=" + gradeList +
                '}';
    }
}
